package com.gpscookie.redpanic;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;

public class PlayerDot extends Entity {
	private static Paint paint;
	private int exploderadius = radius;
	private float lastx = x;
	private float lasty = y;

	public PlayerDot(float ix, float iy) {
		paint = new Paint();
        paint.setColor(Color.BLACK);            
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.FILL);
        paint.setStrokeWidth(0);
		
		width = radius*2;
		height = width;
		x = ix;
		y = iy;
	}
	
	@Override
	public void draw(Canvas canvas) {
		lastx = x;
		lasty = y;
		if (exploderadius>radius) {			
			canvas.drawCircle(x, y, exploderadius, paint);
			exploderadius--;
		} else {
			canvas.drawCircle(x, y, radius, paint);
			canvas.drawPoint(lastx, lasty, paint);
		}
	}
	
	@Override
	public void explode() {
		World.INSTANCE.gameover();
		exploderadius = radius*3;
	}
	
	public float getLastx() {
		return lastx;
	}

	public void setLastx(float lastx) {
		this.lastx = lastx;
	}

	public float getLasty() {
		return lasty;
	}

	public void setLasty(float lasty) {
		this.lasty = lasty;
	}

}
